package com.runshu.newsmartark.mvp.presenter;


import com.runshu.newsmartark.mvp.contract.WarnManagerContract;
import com.runshu.newsmartark.network.netbean.ResponseBean;
import com.runshu.newsmartark.network.netinterface.MyCallBack;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/8/10
 * @decs：
 */

public class WarnManagerPresenter implements WarnManagerContract.Presenter {
    private WarnManagerContract.View view;
    private WarnManagerContract.Model model;

    public WarnManagerPresenter(WarnManagerContract.View view, WarnManagerContract.Model model) {
        this.view = view;
        this.model = model;
    }

    @Override
    public void getWarnList(String mac) {
        model.getWarnList(mac, new MyCallBack() {
            @Override
            public void onSuccess(ResponseBean data) {
                view.OnGetWarnListSuccess(data);
            }

            @Override
            public void onError(ResponseBean data) {
                view.onError(data.getMessage());
            }
        });

    }
}